<?xml version="1.0" encoding="utf-8" ?>
<sqlMap namespace='VwCalendarSum' xmlns='http://ibatis.apache.org/mapping' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
  <alias>
    <typeAlias alias='VwCalendarSum' assembly='Janus.Mes.POCO.dll' type='Janus.Mes.POCO.VwCalendarSum' />
  </alias>
  <resultMaps>
    <resultMap id='VwCalendarSumResult' class='VwCalendarSum'>
	    <result property='Year' column='Year' /> 
	    <result property='WorkCCode' column='WorkCCode' />
      <result property='WorkCName' column='WorkCName' />
      <result property='YearDayTotal' column='YearDayTotal' /> 
	    <result property='WorkDayTotal' column='WorkDayTotal' /> 
	    <result property='WeekDayTotal' column='WeekDayTotal' /> 
	    <result property='HolidayTotal' column='HolidayTotal' /> 
	    <result property='DaysOffTotal' column='DaysOffTotal' /> 
		</resultMap>
  </resultMaps>  
  <statements>
  <sql id="WhereConditions">
	 <dynamic prepend="WHERE">
	  	 <isPropertyAvailable prepend="" property="Year">
        <isNotEmpty prepend="AND" property="Year">
		          [Year]=#Year#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="WorkCCode">
        <isNotEmpty prepend="AND" property="WorkCCode">
		          [WorkCCode]=#WorkCCode#
		          </isNotEmpty>
      </isPropertyAvailable>
	  </dynamic> 
    </sql>
    <!-- select by key statement:-->
    <select id='FindOne' parameterClass='hashtable' resultClass='VwCalendarSum'>
      SELECT * FROM vwCalendarSum WHERE
      <![CDATA[
		[Year]=#pk0#  AND [WorkCCode]=#pk1#
        ]]>
    </select>
    <select id='FindAllCondition' parameterClass='string' resultClass='VwCalendarSum'>
      SELECT * FROM [vwCalendarSum] WHERE $value$
    </select>
    <select id='FindScalar' parameterClass='hashtable' resultClass='VwCalendarSum'>
      SELECT * FROM [vwCalendarSum] WHERE $conditions$
    </select>
    
    <select id='FindAllCount' parameterClass='string' resultClass='int'>
      SELECT COUNT(1) FROM [vwCalendarSum] WHERE $value$
    </select>
    <select id='FindByPage' parameterClass='string' resultClass='VwCalendarSum'>
      SELECT * FROM [vwCalendarSum] WHERE $value$
    </select>
  </statements>
</sqlMap>
